﻿using System;

namespace UniRx.Diagnostics
{
	// Token: 0x020003B6 RID: 950
	public class ObservableLogger : IObservable<LogEntry>
	{
		// Token: 0x0600137A RID: 4986 RVA: 0x00058C67 File Offset: 0x00057067
		private ObservableLogger()
		{
		}

		// Token: 0x0600137B RID: 4987 RVA: 0x00058C6F File Offset: 0x0005706F
		public static Action<LogEntry> RegisterLogger(Logger logger)
		{
			if (logger.Name == null)
			{
				throw new ArgumentNullException("logger.Name is null");
			}
			return new Action<LogEntry>(ObservableLogger.logPublisher.OnNext);
		}

		// Token: 0x0600137C RID: 4988 RVA: 0x00058C97 File Offset: 0x00057097
		public IDisposable Subscribe(IObserver<LogEntry> observer)
		{
			return ObservableLogger.logPublisher.Subscribe(observer);
		}

		// Token: 0x04000B78 RID: 2936
		private static readonly Subject<LogEntry> logPublisher = new Subject<LogEntry>();

		// Token: 0x04000B79 RID: 2937
		public static readonly ObservableLogger Listener = new ObservableLogger();
	}
}
